//
//  AppDelegate.m
//  CoachsBook
//
//  Created by MaBookPro on 2022/8/8.
//

#import "AppDelegate.h"

#import "FirstPageViewController.h"
#import "ClueViewController.h"
#import "ManageViewController.h"
#import "MineViewController.h"

#import "TabbarController.h"




@interface AppDelegate ()

@end

@implementation AppDelegate


- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    [SVProgressHUD setMinimumDismissTimeInterval:2];
    [SVProgressHUD setDefaultStyle:SVProgressHUDStyleDark];
    [self CreatFourModuleButton];
    return YES;
}


#pragma mark - 创建统一四个模块按钮
-(void)CreatFourModuleButton{
    //首页
    FirstPageViewController *firstpage = [[FirstPageViewController alloc]init];
    UINavigationController *firstpageNav = [[UINavigationController alloc]initWithRootViewController:firstpage];
    
    //线索
    ClueViewController *clue = [[ClueViewController alloc]init];
    UINavigationController *clueNav = [[UINavigationController alloc]initWithRootViewController:clue];
    
    //管理
    ManageViewController *manage = [[ManageViewController alloc]init];
    UINavigationController *manageNav= [[UINavigationController alloc]initWithRootViewController:manage];
    
//    //我的
    MineViewController *mine = [[MineViewController alloc]init];
    UINavigationController *mineNav = [[UINavigationController alloc]initWithRootViewController:mine];
    
    //NavigationController嵌套到tabBar内
    
    TabbarController * xttabbar  = [[TabbarController alloc] init];
    xttabbar.viewControllers = @[firstpageNav,clueNav,manageNav,mineNav];
    xttabbar.selectedIndex = 0;
    
    self.window.rootViewController = xttabbar;
    
    //使主窗口显示到屏幕的最前端
    [self.window makeKeyAndVisible];

    
}


@end
